package day1127_2;

import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.Statement;

public class D1 {
    public static void main(String[] args)throws  Exception{
        //1.加载数据库驱动类
        Class.forName("com.mysql.cj.jdbc.Driver");
        Connection  conn= DriverManager.getConnection(
                "jdbc:mysql://localhost:3306/big2?serverTimezone=GMT%2B8&useSSL=false",
                "root","root");//2.
        Statement  stmt=conn.createStatement();//3.
        stmt.execute("insert into  stu value(1,'zhangsan')");//4.
        stmt.execute("insert into  stu value(2,'lisi')");//4.
        conn.close();//5.关闭链接
    }
}






